From: Keir Fraser Date: Fri, 23 Oct 2009 09:13:22 +0000 (+0100) Subject: vtd: interrupt remapping fix X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~13178 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22?a=commitdiff_plain;h=e3d7f1dd25fee2148992962aaaa628f7e9835f13;p=xen.git vtd: interrupt remapping fix Fix the error of translation from int remapping table entry(IRTE) to MSI msg. This error may write wrong IRTE back to the VTd hardware, and block physical interrupts. Signed-Off-By: Zhai Edwin --- diff --git a/xen/drivers/passthrough/vtd/intremap.c b/xen/drivers/passthrough/vtd/intremap.c index 595afbaa1e..f68145df57 100644 --- a/xen/drivers/passthrough/vtd/intremap.c +++ b/xen/drivers/passthrough/vtd/intremap.c @@ -468,8 +468,12 @@ static int remap_entry_to_msi_msg( MSI_ADDR_DESTMODE_LOGIC) | ((iremap_entry->lo.dlm != dest_LowestPrio) ? MSI_ADDR_REDIRECTION_CPU: - MSI_ADDR_REDIRECTION_LOWPRI) | - iremap_entry->lo.dst >> 8; + MSI_ADDR_REDIRECTION_LOWPRI); + if ( x2apic_enabled ) + msg->dest32 = iremap_entry->lo.dst; + else + msg->address_lo |= + ((iremap_entry->lo.dst >> 8) & 0xff ) << MSI_ADDR_DEST_ID_SHIFT; msg->data = MSI_DATA_TRIGGER_EDGE |